<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        // if分支
        let age = 18
        if (age<18) {
            console.log('未成年')
        } else {
            console.log('成年')
        }

        // switch分支
        let time = '早上'
        switch (time) {
            case '早上':
                console.log('赖床')
                break;
                
            case '中午':
                console.log('睡午觉')
                break;
                
            case '晚上':
                console.log('睡觉')
                break;

            default:
                break;
        }
    </script>
</body>
</html>